package com.itheima.jobs;

import com.alibaba.dubbo.config.annotation.Reference;
import com.itheima.service.OrderSettingService;
import com.itheima.utils.DateUtils;

import java.text.SimpleDateFormat;
import java.util.Date;

public class ClearOrderSettingJob {
    @Reference
    private OrderSettingService orderSettingService;

    /**
     * 删除历史预约设置
     * @throws Exception
     */
    public void clearOrderSetting() throws Exception {
        try {
            orderSettingService.delHistoryOrderSetting(DateUtils.getToday());
        } catch (Exception e) {
            e.printStackTrace();
        }
    }

    public static void main(String[] args) {
        System.out.println(DateUtils.getToday());
    }
}
